package com.zucc.service.base;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : charspan
 * @Description :
 * @create : 2021-11-29 4:56 下午
 */
@Data
public class PageData<T> {
    /**
     * 页码，从1开始
     */
    @ApiModelProperty("返回当前页码")
    public Integer pageNum;
    /**
     * 页面大小
     */
    @ApiModelProperty("当前页面大小")
    public Integer pageSize;
    /**
     * 总记录数
     */
    @ApiModelProperty("当前记录总条数")
    public Long total;
    @ApiModelProperty("列表数据")
    public List<T> list;

    public PageData() {
        this.pageNum = 0;
        this.pageSize = 0;
        this.total = 0L;
        this.list = new ArrayList<>();
    }

    public PageData(Integer page, Integer pageSize, Long total, List<T> data) {
        this.pageNum = page;
        this.pageSize = pageSize;
        this.total = total;
        this.list = data;
    }
}
